package com.yidu.mapper;

import com.yidu.entity.Book;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Repository
public interface BookMapper {
    @Select("select * from book limit #{page},#{limit}")
    public List<Book> selectBook (Map map);
    @Insert("insert into book VALUES (#{bookId},#{bookName},#{bookPrice},#{bookDesc})")
    public void insertBook(Book book);
    @Update("UPDATE book set bookName = #{bookName} , bookPrice =  #{bookPrice} , bookDesc = #{bookDesc} where bookId = #{bookId}")
    public void updateBook(Book book);
    @Delete("delete from book where bookId = #{bookId}")
    public void deleteBook(String bookId);
}
